<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>6.270 - JoyOS: lib/motor_group.h File Reference</title>
	<link href="main.css" media="screen" rel="Stylesheet" type="text/css"/>
	<link href="doxygen.css" rel="stylesheet" type="text/css">
</head>  
<body>
	<div id="header">
		<div id="headerb">
		<div id="headtext">
			<span class="titletext">AUTONOMOUS ROBOT DESIGN COMPETITION</span>
			6.270
		</div>
		<div class="mainmenu">
			<a href="http://web.mit.edu/6.270/www">Home</a>
		 	&bull;
			<a href="http://web.mit.edu/6.270/www/about/">About</a> 
		 	&bull;
			<a href="http://web.mit.edu/6.270/www/sponsors/">Sponsors</a>
		 	&bull;
			<a href="http://web.mit.edu/6.270/www/contests/">Past Contests</a> 
		 	&bull;
			<a href="http://web.mit.edu/6.270/www/contestants/">Contestant Information</a>
		</div>
	</div>
	</div>

<div class="maincontent">
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>lib/motor_group.h File Reference</h1>A grouping of motors as single unit. <a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="global_8h.html">kern/global.h</a>&gt;</code><br>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="313108f4041ed1ccbd4348ae6250bb40"></a><!-- doxytag: member="motor_group.h::motor_group_has" ref="313108f4041ed1ccbd4348ae6250bb40" args="(group, motor)" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="motor__group_8h.html#313108f4041ed1ccbd4348ae6250bb40">motor_group_has</a>(group, motor)&nbsp;&nbsp;&nbsp;((group)&amp;(1&lt;&lt;(motor)))</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Check if a group contains a motor. <br></td></tr>
<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="bf80c97904f3c321e634674c7a1d8002"></a><!-- doxytag: member="motor_group.h::MotorGroup" ref="bf80c97904f3c321e634674c7a1d8002" args="" -->
typedef uint8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="motor__group_8h.html#bf80c97904f3c321e634674c7a1d8002">MotorGroup</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">MotorGroup. <br></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="motor__group_8h.html#bf80c97904f3c321e634674c7a1d8002">MotorGroup</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="motor__group_8h.html#93d7aa92aca541df458e506626ec60b3">motor_group_new</a> (bool m0, bool m1, bool m2, bool m3, bool m4, bool m5)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="motor__group_8h.html#c397238e673523095485dd8e15a2cf16">motor_group_set_vel</a> (<a class="el" href="motor__group_8h.html#bf80c97904f3c321e634674c7a1d8002">MotorGroup</a> group, int16_t vel)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="motor__group_8h.html#03c56ffd376f7ae54b06a3b8791e7117">motor_group_brake</a> (<a class="el" href="motor__group_8h.html#bf80c97904f3c321e634674c7a1d8002">MotorGroup</a> group)</td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A motor group is a collection of motors that act as a single unit. This is useful in the situation where many motors are connected to single output shaft. A motor group allows these motors to be treated as a single entity. <hr><h2>Function Documentation</h2>
<a class="anchor" name="03c56ffd376f7ae54b06a3b8791e7117"></a><!-- doxytag: member="motor_group.h::motor_group_brake" ref="03c56ffd376f7ae54b06a3b8791e7117" args="(MotorGroup group)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void motor_group_brake           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="motor__group_8h.html#bf80c97904f3c321e634674c7a1d8002">MotorGroup</a>&nbsp;</td>
          <td class="paramname"> <em>group</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Brake each motor in a group<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>group</em>&nbsp;</td><td>group specifying which motors to brake </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="93d7aa92aca541df458e506626ec60b3"></a><!-- doxytag: member="motor_group.h::motor_group_new" ref="93d7aa92aca541df458e506626ec60b3" args="(bool m0, bool m1, bool m2, bool m3, bool m4, bool m5)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="motor__group_8h.html#bf80c97904f3c321e634674c7a1d8002">MotorGroup</a> motor_group_new           </td>
          <td>(</td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>m0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>m1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>m2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>m3</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>m4</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>m5</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Create a new motor group and specify which motors are in the group. For example, a group with motors 1,2 and 3: <div class="fragment"><pre class="fragment"> <a class="code" href="motor__group_8h.html#bf80c97904f3c321e634674c7a1d8002" title="MotorGroup.">MotorGroup</a> m123 = <a class="code" href="motor__group_8h.html#93d7aa92aca541df458e506626ec60b3">motor_group_new</a>(0,1,1,1,0,0);
</pre></div> 
</div>
</div><p>
<a class="anchor" name="c397238e673523095485dd8e15a2cf16"></a><!-- doxytag: member="motor_group.h::motor_group_set_vel" ref="c397238e673523095485dd8e15a2cf16" args="(MotorGroup group, int16_t vel)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void motor_group_set_vel           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="motor__group_8h.html#bf80c97904f3c321e634674c7a1d8002">MotorGroup</a>&nbsp;</td>
          <td class="paramname"> <em>group</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int16_t&nbsp;</td>
          <td class="paramname"> <em>vel</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set the velocity of each motor in the group<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>group</em>&nbsp;</td><td>group specifying which motors to set </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>vel</em>&nbsp;</td><td>motor velocity </td></tr>
  </table>
</dl>

</div>
</div><p>
</div>
</div>
<div class="maincontent">
	<div class="footer centre">
		<hr>
		Generated on Sun Jan 18 22:59:34 2009 by&nbsp;<a href="http://www.doxygen.org/index.html">Doxygen</a> 1.5.6<br/>
		6.270 Staff, 2008 | 
		<a href="mailto:6.270-organizers@mit.edu">Contact Us</a> | 
		<a href="http://web.mit.edu">MIT</a>
	</div>
</div>
</body>
</html>
